#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

class Solution{
    private:
    unordered_map<int, int> map;

    public:
    int ans1(vector<int>& nums){
        int len = nums.size();
        for(int i = 0; i != len; i++){
            map[nums[i]]++;
        }
        int ret = 0;
        for(auto& [num, counts]: map){
            if(counts != 2){
                ret = num;
                break;
            }
        }

        return ret;
    }
};

void test1(){
    Solution s;
    vector<int> nums = {2,2,1};

    int ret = s.ans1(nums);
    cout << ret << endl;
}

void test2(){
    Solution s;
    vector<int> nums = {4,1,2,1,2};

    int ret = s.ans1(nums);
    cout << ret << endl;
}

void test3(){
    Solution s;
    vector<int> nums = {1};

    int ret = s.ans1(nums);
    cout << ret << endl;
}

int main(void){
    test1();
    test2();
    test3();

    return 0;
}